package com.spdg.ring.sqlite.model;

import java.io.Serializable;

import cn.wolf.sqlite.anotation.Column;
import cn.wolf.sqlite.anotation.Id;
import cn.wolf.sqlite.anotation.Table;

@Table(name = "t_article_list")
public class ArticleList implements Serializable {

	private static final long serialVersionUID = 209016369672945006L;

	@Id
	@Column(name = "id")
	private int id; // 自增ID

	@Column(name = "name", length = 200)
	private String name; // 列表名

	@Column(name = "title", length = 500)
	private String title; // 详细页面标题

	@Column(name = "type", length = 20)
	private String type; // 数据类型：列表，详细文章

	@Column(name = "icon", length = 200)
	private String icon; // 图片地址

	@Column(name = "icon_file", length = 200)
	private String iconFile; // 图片文件名，用于缓存sd

	@Column(name = "src", length = 200)
	private String src; // 数据源地址

	@Column(name = "id_name", length = 200)
	private String idName; // 用于上下文跳转

	@Column(name = "date", length = 20)
	private String date; // 文章时间

	@Column(name = "file", length = 50)
	private String file; // 离线文件名

	@Column(name = "summary", length = 2000)
	private String summary; // 简要描述

	@Column(name = "group_name", length = 300)
	private String group; // 分组名

	@Column(name = "sharelink", length = 100)
	private String sharelink; // 文章web地址

	@Column(name = "sharehead", length = 100)
	private String sharehead; // 头部

	@Column(name = "parentfile", length = 100)
	private String parentFile; // 父级FileID

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getIconFile() {
		return iconFile;
	}

	public void setIconFile(String iconFile) {
		this.iconFile = iconFile;
	}

	public String getSrc() {
		return src;
	}

	public void setSrc(String src) {
		this.src = src;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getFile() {
		return file;
	}

	public void setFile(String file) {
		this.file = file;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}

	public String getSharelink() {
		return sharelink;
	}

	public void setSharelink(String sharelink) {
		this.sharelink = sharelink;
	}

	public String getSharehead() {
		return sharehead;
	}

	public void setSharehead(String sharehead) {
		this.sharehead = sharehead;
	}

	public String getParentFile() {
		return parentFile;
	}

	public void setParentFile(String parentFile) {
		this.parentFile = parentFile;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getIdName() {
		return idName;
	}

	public void setIdName(String idName) {
		this.idName = idName;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	@Override
	public String toString(){
		return "{name:" + name + 
				" title:" + title +
				" type:" + type +
				" icon:" + icon +
				" iconFile:" + iconFile +
				" src:" + src +
				" idName:" + idName +
				" date:" + date +
				" file:" + file +
				" summary:" + summary +
				" group:" + group +
				" sharelink:" + sharelink +
				" sharehead:" + sharehead +
				" parentFile:" + parentFile +
			   "}";
	}

//	public class ComparatorArticleList implements Comparator<ArticleList> {
//		@Override
//		public int compare(ArticleList obj1, ArticleList obj2) {
//			ArticleList articleList1 = (ArticleList) obj1;
//			ArticleList articleList2 = (ArticleList) obj2;
//
//			return articleList1.getFile().compareTo(articleList2.getFile());
//		}
//	}
}
